import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/HomeView.vue'
import SecondRoute from '../utils/SecondRoute'
import TwoRoute from '../utils/TwoRoute'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: home
  },
  {
    path: '/teach',
    name: 'teach',
    component: () => import(/* webpackChunkName: "teach" */
      "@/views/TeachView.vue"),
  },
  {
    path: '/painter',
    // name: 'painter',
    component: () => import(/* webpackChunkName: "painter" */
      "@/views/PainterView.vue"),
    children: [
      SecondRoute("", "LiveView"),
      SecondRoute("talk", "TalkView"),
      SecondRoute("product", "ProductView"),
    ]
  },
  {
    path:'/daniuCourse/:id',
    name:'LiveDetil',
    component:()=>import(/* webpackChunkName: "liveDetil" */ "@/views/LiveDetil.vue"),
  },
  {
    path: '/school',
    name: 'school',
    component: () => import(/* webpackChunkName: "school" */
      "@/views/WebSchoolView.vue")
  },
  {
    path: '/community',
    // name: 'community',
    component: () => import(/* webpackChunkName: "about" */
      "@/views/Community.vue"),
      children:[
        TwoRoute("","WorkView"),
        TwoRoute("question","QuestionView"),
        TwoRoute("artwork","ArtWork"),
        TwoRoute("pointer","PointerView")
      ]
  },



]

const router = new VueRouter({
  routes
})

export default router
